import 'reflect-metadata';
import { Middleware } from 'koa';

/**
 * @func Middlewares
 * @desc 中间件装饰器
 * @param middlewares
 * @constructor
 */
export const Middlewares = (middlewares: Middleware[]) => {
  return (target: any, methodIdentifier: string | symbol, _: PropertyDescriptor) => {
    Reflect.defineMetadata('middlewares', middlewares, target, methodIdentifier);
  };
};
